package fractal

import util._
import Math._

class BurningShip extends EscapeTimeFractal
{
	override val name = "Burning Ship"
	override val params = Nil
	override val axes = (-2.0, 2.0, -2.0, 2.0)
	override val limit = 2.0
	override val numIters = 500

 	override def getBW(c: Complex): Int = 
	{
		var z = Complex(0.0, 0.0)
		for (i <- 0 until numIters)
		{
			var x = Complex(abs(z.real), abs(z.imag))
			z = x*x + c
			if (z.mag > limit) return 0xFFFFFF
		}
		0x000000
	}
 
	override def getColor(c: Complex): Int = 
	{
		var z = Complex(0.0, 0.0)
		for (i <- 0 until numIters)
		{
			var x = Complex(abs(z.real), abs(z.imag))
			z = x*x + c;
			if (z.mag > limit)
				return COLORS(i*COLORS.length/numIters)
		}
		0x000000
	}
}
